
package com.feng.fengDUtil.dao;
import java.util.Arrays;
import java.util.List;

public class SqlAndParams {
    private String sql;
    private Object[] params;
    private String sortField;
    private String sortOrder;
    private int pageIndex;
    private int pageSize;

    public int getPageIndex() {
        return this.pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getSortField() {
        return this.sortField;
    }

    public void setSortField(String sortField) {
        this.sortField = sortField;
    }

    public String getSortOrder() {
        return this.sortOrder;
    }

    public void setSortOrder(String sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getSql() {
        return this.sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public Object[] getParams() {
        return this.params;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }

    public SqlAndParams(String sql, Object[] params) {
        this.sql = sql;
        this.params = params;
    }

    public SqlAndParams(String sql, String sortField, String sortOrder, List<Object> params) {
        this.sql = sql;
        this.sortField = sortField;
        this.sortOrder = sortOrder;
        this.params = params.toArray();
    }

    public SqlAndParams(String sql, List<Object> params) {
        this.sql = sql;
        this.params = params.toArray();
    }

    public SqlAndParams(StringBuilder sql, List<Object> params) {
        this(sql.toString(), "", "", params);
    }

    public SqlAndParams() {
    }

    public String toString() {
        return "sql=" + this.sql + ",params=" + Arrays.asList(this.params);
    }
}
